home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’97 / Bill Boot / source code / BillBootTest.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-06-27  |  531 b   |  41 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        TestWinBoot.c
  3.     
  4.     Contains:    Tests the winboot hack
  5.  
  6.     Written by:    Eric Traut
  7.  
  8.     Date:        6/25/97
  9.  
  10. */
  11.  
  12. #include <Resources.h>
  13. #include <Memory.h>
  14.  
  15. typedef void ResourceMainProc(void);
  16.  
  17. void
  18. main(void)
  19. {
  20.     Handle                codeResource;
  21.     ResourceMainProc*    mainEntry;
  22.     
  23.     codeResource = Get1Resource('INIT', 500);
  24.     if (codeResource == NULL)
  25.         DebugStr("\pCode resource not found");
  26.     
  27.     DetachResource(codeResource);
  28.     
  29.     MoveHHi(codeResource);
  30.     HLock(codeResource);
  31.     
  32.     mainEntry = (ResourceMainProc*)*codeResource;
  33.     (*mainEntry)();
  34. }
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.